<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>支付设置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header"><i class="fa fa-cog"></i> 支付设置</div>
				<div class="layui-card-body" pad15>
					<div class="layui-form" lay-filter="">
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">微支付状态：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[wxpay]" title="开启" value="1" {if $info['wxpay']==1}checked{/if}/>
								<input type="radio" name="info[wxpay]" title="关闭" value="0" {if $info['wxpay']==0}checked{/if}/>
							</div>
							<!-- <div class="layui-form-mid">JSAPI支付授权目录：<b>{$Request.domain}/</b></div> -->
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">微支付模式：</label>
							<div class="layui-input-inline" style="width:500px">
								<input type="radio" name="info[wxpay_type]" title="普通模式" value="0" {if $info['wxpay_type']==0}checked{/if} lay-filter="wxpay_type"/>
								<input type="radio" name="info[wxpay_type]" title="服务商模式" value="1" {if $info['wxpay_type']==1}checked{/if} lay-filter="wxpay_type"/>
								<input type="radio" name="info[wxpay_type]" title="二级商户模式" value="2" {if $info['wxpay_type']==2}checked{/if} lay-filter="wxpay_type"/>
								<input type="radio" name="info[wxpay_type]" title="随行付" value="3" {if $info['wxpay_type']==3}checked{/if} lay-filter="wxpay_type"/>
							</div>
						</div>
						<div class="layui-form-item" id="wxpay_type1set" {if $info['wxpay_type']!=1}style="display:none"{/if}>
							<label class="layui-form-label" style="width:130px">支付商户号：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[wxpay_sub_mchid]" value="{$info['wxpay_sub_mchid']}" class="layui-input"/>
							</div>
						</div>
						<div class="layui-form-item" id="wxpay_type2set" {if $info['wxpay_type']!=2}style="display:none"{/if}>
							<label class="layui-form-label" style="width:130px">支付商户号：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[wxpay_sub_mchid2]" value="{$info['wxpay_sub_mchid2']}" class="layui-input"/>
							</div>
						</div>
						<div id="wxpay_type3set" {if $info['wxpay_type']!=3}style="display:none"{/if}>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">商户编号：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[sxpay_mno]" value="{$info['sxpay_mno']}" class="layui-input"/>
							</div>
							<div class="layui-form-mid layui-word-aux"> <a href="javascript:void(0)" onclick="openmax('{:url('SxpayIncome/index')}&isopen=1')">点击申请入驻</a></div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px">支付密钥：</label>
							<div class="layui-input-inline" style="width:280px">
								<input type="text" name="info[sxpay_mchkey]" value="{$info['sxpay_mchkey']}" class="layui-input"/>
								{if $info['sxpay_mchkey']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
							</div>
						</div>
						</div>
						<div id="wxpay_type0set" {if $info['wxpay_type']!=0}style="display:none"{/if}>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:130px">支付商户号：</label>
								<div class="layui-input-inline">
									<input type="text" name="info[wxpay_mchid]" value="{$info['wxpay_mchid']}" class="layui-input"/>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:130px">支付密钥：</label>
								<div class="layui-input-inline" style="width:280px">
									<input type="text" name="info[wxpay_mchkey]" value="{$info['wxpay_mchkey']}" class="layui-input"/>
									{if $info['wxpay_mchkey']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								</div>
								<div class="layui-form-mid layui-word-aux">请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[API密钥]</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:130px">PEM证书：</label>
								<input type="hidden" name="info[wxpay_apiclient_cert]" value="{$info['wxpay_apiclient_cert']}" id="wxpay_apiclient_cert"/>
								<button style="float:left;" type="button" class="layui-btn layui-btn-primary uploadfile" upload-input="wxpay_apiclient_cert" upload-preview="certPreview">上传</button>
								<div id="certPreview" class="layui-form-mid" style="margin-left:20px;">{if $info['wxpay_apiclient_cert']}已上传{/if}</div>
								<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">apiclient_cert.pem 请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[API证书]，设置完成后上传</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:130px">证书密钥：</label>
								<input type="hidden" name="info[wxpay_apiclient_key]" value="{$info['wxpay_apiclient_key']}" id="wxpay_apiclient_key"/>
								<button style="float:left;" type="button" class="layui-btn layui-btn-primary uploadfile" upload-input="wxpay_apiclient_key" upload-preview="keyPreview">上传</button>
								<div id="keyPreview" class="layui-form-mid" style="margin-left:20px;">{if $info['wxpay_apiclient_key']}已上传{/if}</div>
								<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">apiclient_key.pem 请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[API证书]，设置完成后上传</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:130px">证书序列号：</label>
								<div class="layui-input-inline" style="width:360px">
									<input type="text" name="info[wxpay_serial_no]" value="{$info['wxpay_serial_no']}" class="layui-input"/>
									{if $info['wxpay_serial_no']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								</div>
								<div class="layui-form-mid">使用商家转账到零钱功能时填写此项，否则不需要填写</div>
								<div class="layui-form-mid layui-word-aux">请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]-[管理证书]中查看</div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" style="width:130px"></label>
							<div class="layui-input-block">
								<button class="layui-btn" lay-submit lay-filter="formsubmit">提 交</button>
							</div>
						</div>
					</div>
				</div>
      </div>
    </div>
  </div>
	{include file="public/js"/}
	<script>
	layui.form.on('radio(wxpay_type)', function(data){
		$('#wxpay_type0set').hide();
		$('#wxpay_type1set').hide();
		$('#wxpay_type2set').hide();
		$('#wxpay_type3set').hide();
		if(data.value == '0'){
			$('#wxpay_type0set').show();
		}else if(data.value == '1'){
			$('#wxpay_type1set').show();
		}else if(data.value == '2'){
			$('#wxpay_type2set').show();
		}else if(data.value == '3'){
			$('#wxpay_type3set').show();
		}
	})
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		$.post('',field,function(data){
			dialog(data.msg,data.status,data.url);
		})
	})
  </script>
	{include file="public/copyright"/}
</body>
</html>